/**
 * Copyright (C) 2018-2021
 * All rights reserved, Designed By www.yixiang.co

 */
package com.station.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author hupeng
 * 订单相关枚举
 */
@Getter
@AllArgsConstructor
public enum ErpOrderTypeEnum {

	ERP_ORDER_TYPE_0(0,"采购订单"),
	ERP_ORDER_TYPE_1(1,"采购收货单"),
	ERP_ORDER_TYPE_2(2,"付款单"),
	ERP_ORDER_TYPE_3(3,"采购退料单"),
	ERP_ORDER_TYPE_4(4,"调拨单"),
	ERP_ORDER_TYPE_5(5,"销售订单"),
	ERP_ORDER_TYPE_6(6,"销售退货单"),
	ERP_ORDER_TYPE_7(7,"领用单"),
	ERP_ORDER_TYPE_8(8,"收款单");

	private Integer value;
	private String desc;

	public static ErpOrderTypeEnum toType(int value) {
		return Stream.of(ErpOrderTypeEnum.values())
				.filter(p -> p.value == value)
				.findAny()
				.orElse(null);
	}


}
